package com.zycfc.zsf.boot.job;

import com.zycfc.zsf.boot.job.common.*;
import com.zycfc.zsf.boot.job.enums.*;

public class ZsfJobProperties
{
    private String jobName;
    private String cron;
    private String fixedIp;
    private boolean shardingTdSql;
    private int shardingTotalCount;
    private String shardingItemParameters;
    private String jobParameter;
    private boolean failover;
    private boolean misfire;
    private String description;
    private boolean overwrite;
    private boolean monitorExecution;
    private int monitorPort;
    private int maxTimeDiffSeconds;
    private int reconcileIntervalMinutes;
    private boolean disabled;
    private long startedTimeoutMilliseconds;
    private boolean test;
    private long completedTimeoutMilliseconds;
    private CallType callType;
    private IdempotentType idempotent;
    private ShardingStrategy shardingStrategy;
    
    public ZsfJobProperties() {
        this.shardingTotalCount = 1;
        this.shardingItemParameters = "";
        this.jobParameter = "";
        this.failover = false;
        this.misfire = false;
        this.description = "";
        this.overwrite = false;
        this.monitorExecution = true;
        this.monitorPort = -1;
        this.maxTimeDiffSeconds = -1;
        this.reconcileIntervalMinutes = 10;
        this.disabled = false;
        this.startedTimeoutMilliseconds = Long.MAX_VALUE;
        this.test = false;
        this.completedTimeoutMilliseconds = Long.MAX_VALUE;
        this.callType = CallType.CALL_CHAIN_NO;
        this.idempotent = IdempotentType.M;
        this.shardingStrategy = ShardingStrategy.RANDOM;
    }
    
    public ZsfJobProperties(final ZsfJob elasticjob) {
        this.shardingTotalCount = 1;
        this.shardingItemParameters = "";
        this.jobParameter = "";
        this.failover = false;
        this.misfire = false;
        this.description = "";
        this.overwrite = false;
        this.monitorExecution = true;
        this.monitorPort = -1;
        this.maxTimeDiffSeconds = -1;
        this.reconcileIntervalMinutes = 10;
        this.disabled = false;
        this.startedTimeoutMilliseconds = Long.MAX_VALUE;
        this.test = false;
        this.completedTimeoutMilliseconds = Long.MAX_VALUE;
        this.callType = CallType.CALL_CHAIN_NO;
        this.idempotent = IdempotentType.M;
        this.shardingStrategy = ShardingStrategy.RANDOM;
        this.jobName = elasticjob.jobName();
        this.cron = elasticjob.cron();
        this.shardingTotalCount = elasticjob.shardingTotalCount();
        this.fixedIp = elasticjob.fixedIp();
        this.shardingTdSql = elasticjob.shardingTdSql();
        this.shardingItemParameters = elasticjob.shardingItemParameters();
        this.jobParameter = elasticjob.jobParameter();
        this.failover = elasticjob.failover();
        this.misfire = elasticjob.misfire();
        this.description = elasticjob.description();
        this.overwrite = elasticjob.overwrite();
        this.monitorExecution = elasticjob.monitorExecution();
        this.monitorPort = elasticjob.monitorPort();
        this.maxTimeDiffSeconds = elasticjob.maxTimeDiffSeconds();
        this.reconcileIntervalMinutes = elasticjob.reconcileIntervalMinutes();
        this.disabled = elasticjob.disabled();
        this.startedTimeoutMilliseconds = elasticjob.startedTimeoutMilliseconds();
        this.completedTimeoutMilliseconds = elasticjob.completedTimeoutMilliseconds();
        this.callType = elasticjob.callType();
        this.test = elasticjob.test();
        this.idempotent = elasticjob.idempotent();
        this.shardingStrategy = elasticjob.shardingStrategy();
    }
    
    public String getJobName() {
        return this.jobName;
    }
    
    public String getCron() {
        return this.cron;
    }
    
    public String getFixedIp() {
        return this.fixedIp;
    }
    
    public boolean isShardingTdSql() {
        return this.shardingTdSql;
    }
    
    public int getShardingTotalCount() {
        return this.shardingTotalCount;
    }
    
    public String getShardingItemParameters() {
        return this.shardingItemParameters;
    }
    
    public String getJobParameter() {
        return this.jobParameter;
    }
    
    public boolean isFailover() {
        return this.failover;
    }
    
    public boolean isMisfire() {
        return this.misfire;
    }
    
    public String getDescription() {
        return this.description;
    }
    
    public boolean isOverwrite() {
        return this.overwrite;
    }
    
    public boolean isMonitorExecution() {
        return this.monitorExecution;
    }
    
    public int getMonitorPort() {
        return this.monitorPort;
    }
    
    public int getMaxTimeDiffSeconds() {
        return this.maxTimeDiffSeconds;
    }
    
    public int getReconcileIntervalMinutes() {
        return this.reconcileIntervalMinutes;
    }
    
    public boolean isDisabled() {
        return this.disabled;
    }
    
    public long getStartedTimeoutMilliseconds() {
        return this.startedTimeoutMilliseconds;
    }
    
    public boolean isTest() {
        return this.test;
    }
    
    public long getCompletedTimeoutMilliseconds() {
        return this.completedTimeoutMilliseconds;
    }
    
    public CallType getCallType() {
        return this.callType;
    }
    
    public IdempotentType getIdempotent() {
        return this.idempotent;
    }
    
    public ShardingStrategy getShardingStrategy() {
        return this.shardingStrategy;
    }
    
    public void setJobName(final String jobName) {
        this.jobName = jobName;
    }
    
    public void setCron(final String cron) {
        this.cron = cron;
    }
    
    public void setFixedIp(final String fixedIp) {
        this.fixedIp = fixedIp;
    }
    
    public void setShardingTdSql(final boolean shardingTdSql) {
        this.shardingTdSql = shardingTdSql;
    }
    
    public void setShardingTotalCount(final int shardingTotalCount) {
        this.shardingTotalCount = shardingTotalCount;
    }
    
    public void setShardingItemParameters(final String shardingItemParameters) {
        this.shardingItemParameters = shardingItemParameters;
    }
    
    public void setJobParameter(final String jobParameter) {
        this.jobParameter = jobParameter;
    }
    
    public void setFailover(final boolean failover) {
        this.failover = failover;
    }
    
    public void setMisfire(final boolean misfire) {
        this.misfire = misfire;
    }
    
    public void setDescription(final String description) {
        this.description = description;
    }
    
    public void setOverwrite(final boolean overwrite) {
        this.overwrite = overwrite;
    }
    
    public void setMonitorExecution(final boolean monitorExecution) {
        this.monitorExecution = monitorExecution;
    }
    
    public void setMonitorPort(final int monitorPort) {
        this.monitorPort = monitorPort;
    }
    
    public void setMaxTimeDiffSeconds(final int maxTimeDiffSeconds) {
        this.maxTimeDiffSeconds = maxTimeDiffSeconds;
    }
    
    public void setReconcileIntervalMinutes(final int reconcileIntervalMinutes) {
        this.reconcileIntervalMinutes = reconcileIntervalMinutes;
    }
    
    public void setDisabled(final boolean disabled) {
        this.disabled = disabled;
    }
    
    public void setStartedTimeoutMilliseconds(final long startedTimeoutMilliseconds) {
        this.startedTimeoutMilliseconds = startedTimeoutMilliseconds;
    }
    
    public void setTest(final boolean test) {
        this.test = test;
    }
    
    public void setCompletedTimeoutMilliseconds(final long completedTimeoutMilliseconds) {
        this.completedTimeoutMilliseconds = completedTimeoutMilliseconds;
    }
    
    public void setCallType(final CallType callType) {
        this.callType = callType;
    }
    
    public void setIdempotent(final IdempotentType idempotent) {
        this.idempotent = idempotent;
    }
    
    public void setShardingStrategy(final ShardingStrategy shardingStrategy) {
        this.shardingStrategy = shardingStrategy;
    }
    
    @Override
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof ZsfJobProperties)) {
            return false;
        }
        final ZsfJobProperties other = (ZsfJobProperties)o;
        if (!other.canEqual(this)) {
            return false;
        }
        final Object this$jobName = this.getJobName();
        final Object other$jobName = other.getJobName();
        Label_0065: {
            if (this$jobName == null) {
                if (other$jobName == null) {
                    break Label_0065;
                }
            }
            else if (this$jobName.equals(other$jobName)) {
                break Label_0065;
            }
            return false;
        }
        final Object this$cron = this.getCron();
        final Object other$cron = other.getCron();
        Label_0102: {
            if (this$cron == null) {
                if (other$cron == null) {
                    break Label_0102;
                }
            }
            else if (this$cron.equals(other$cron)) {
                break Label_0102;
            }
            return false;
        }
        final Object this$fixedIp = this.getFixedIp();
        final Object other$fixedIp = other.getFixedIp();
        Label_0139: {
            if (this$fixedIp == null) {
                if (other$fixedIp == null) {
                    break Label_0139;
                }
            }
            else if (this$fixedIp.equals(other$fixedIp)) {
                break Label_0139;
            }
            return false;
        }
        if (this.isShardingTdSql() != other.isShardingTdSql()) {
            return false;
        }
        if (this.getShardingTotalCount() != other.getShardingTotalCount()) {
            return false;
        }
        final Object this$shardingItemParameters = this.getShardingItemParameters();
        final Object other$shardingItemParameters = other.getShardingItemParameters();
        Label_0202: {
            if (this$shardingItemParameters == null) {
                if (other$shardingItemParameters == null) {
                    break Label_0202;
                }
            }
            else if (this$shardingItemParameters.equals(other$shardingItemParameters)) {
                break Label_0202;
            }
            return false;
        }
        final Object this$jobParameter = this.getJobParameter();
        final Object other$jobParameter = other.getJobParameter();
        Label_0239: {
            if (this$jobParameter == null) {
                if (other$jobParameter == null) {
                    break Label_0239;
                }
            }
            else if (this$jobParameter.equals(other$jobParameter)) {
                break Label_0239;
            }
            return false;
        }
        if (this.isFailover() != other.isFailover()) {
            return false;
        }
        if (this.isMisfire() != other.isMisfire()) {
            return false;
        }
        final Object this$description = this.getDescription();
        final Object other$description = other.getDescription();
        Label_0302: {
            if (this$description == null) {
                if (other$description == null) {
                    break Label_0302;
                }
            }
            else if (this$description.equals(other$description)) {
                break Label_0302;
            }
            return false;
        }
        if (this.isOverwrite() != other.isOverwrite()) {
            return false;
        }
        if (this.isMonitorExecution() != other.isMonitorExecution()) {
            return false;
        }
        if (this.getMonitorPort() != other.getMonitorPort()) {
            return false;
        }
        if (this.getMaxTimeDiffSeconds() != other.getMaxTimeDiffSeconds()) {
            return false;
        }
        if (this.getReconcileIntervalMinutes() != other.getReconcileIntervalMinutes()) {
            return false;
        }
        if (this.isDisabled() != other.isDisabled()) {
            return false;
        }
        if (this.getStartedTimeoutMilliseconds() != other.getStartedTimeoutMilliseconds()) {
            return false;
        }
        if (this.isTest() != other.isTest()) {
            return false;
        }
        if (this.getCompletedTimeoutMilliseconds() != other.getCompletedTimeoutMilliseconds()) {
            return false;
        }
        final Object this$callType = this.getCallType();
        final Object other$callType = other.getCallType();
        Label_0458: {
            if (this$callType == null) {
                if (other$callType == null) {
                    break Label_0458;
                }
            }
            else if (this$callType.equals(other$callType)) {
                break Label_0458;
            }
            return false;
        }
        final Object this$idempotent = this.getIdempotent();
        final Object other$idempotent = other.getIdempotent();
        Label_0495: {
            if (this$idempotent == null) {
                if (other$idempotent == null) {
                    break Label_0495;
                }
            }
            else if (this$idempotent.equals(other$idempotent)) {
                break Label_0495;
            }
            return false;
        }
        final Object this$shardingStrategy = this.getShardingStrategy();
        final Object other$shardingStrategy = other.getShardingStrategy();
        if (this$shardingStrategy == null) {
            if (other$shardingStrategy == null) {
                return true;
            }
        }
        else if (this$shardingStrategy.equals(other$shardingStrategy)) {
            return true;
        }
        return false;
    }
    
    protected boolean canEqual(final Object other) {
        return other instanceof ZsfJobProperties;
    }
    
    @Override
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $jobName = this.getJobName();
        result = result * 59 + (($jobName == null) ? 43 : $jobName.hashCode());
        final Object $cron = this.getCron();
        result = result * 59 + (($cron == null) ? 43 : $cron.hashCode());
        final Object $fixedIp = this.getFixedIp();
        result = result * 59 + (($fixedIp == null) ? 43 : $fixedIp.hashCode());
        result = result * 59 + (this.isShardingTdSql() ? 79 : 97);
        result = result * 59 + this.getShardingTotalCount();
        final Object $shardingItemParameters = this.getShardingItemParameters();
        result = result * 59 + (($shardingItemParameters == null) ? 43 : $shardingItemParameters.hashCode());
        final Object $jobParameter = this.getJobParameter();
        result = result * 59 + (($jobParameter == null) ? 43 : $jobParameter.hashCode());
        result = result * 59 + (this.isFailover() ? 79 : 97);
        result = result * 59 + (this.isMisfire() ? 79 : 97);
        final Object $description = this.getDescription();
        result = result * 59 + (($description == null) ? 43 : $description.hashCode());
        result = result * 59 + (this.isOverwrite() ? 79 : 97);
        result = result * 59 + (this.isMonitorExecution() ? 79 : 97);
        result = result * 59 + this.getMonitorPort();
        result = result * 59 + this.getMaxTimeDiffSeconds();
        result = result * 59 + this.getReconcileIntervalMinutes();
        result = result * 59 + (this.isDisabled() ? 79 : 97);
        final long $startedTimeoutMilliseconds = this.getStartedTimeoutMilliseconds();
        result = result * 59 + (int)($startedTimeoutMilliseconds >>> 32 ^ $startedTimeoutMilliseconds);
        result = result * 59 + (this.isTest() ? 79 : 97);
        final long $completedTimeoutMilliseconds = this.getCompletedTimeoutMilliseconds();
        result = result * 59 + (int)($completedTimeoutMilliseconds >>> 32 ^ $completedTimeoutMilliseconds);
        final Object $callType = this.getCallType();
        result = result * 59 + (($callType == null) ? 43 : $callType.hashCode());
        final Object $idempotent = this.getIdempotent();
        result = result * 59 + (($idempotent == null) ? 43 : $idempotent.hashCode());
        final Object $shardingStrategy = this.getShardingStrategy();
        result = result * 59 + (($shardingStrategy == null) ? 43 : $shardingStrategy.hashCode());
        return result;
    }
    
    @Override
    public String toString() {
        return "ZsfJobProperties(jobName=" + this.getJobName() + ", cron=" + this.getCron() + ", fixedIp=" + this.getFixedIp() + ", shardingTdSql=" + this.isShardingTdSql() + ", shardingTotalCount=" + this.getShardingTotalCount() + ", shardingItemParameters=" + this.getShardingItemParameters() + ", jobParameter=" + this.getJobParameter() + ", failover=" + this.isFailover() + ", misfire=" + this.isMisfire() + ", description=" + this.getDescription() + ", overwrite=" + this.isOverwrite() + ", monitorExecution=" + this.isMonitorExecution() + ", monitorPort=" + this.getMonitorPort() + ", maxTimeDiffSeconds=" + this.getMaxTimeDiffSeconds() + ", reconcileIntervalMinutes=" + this.getReconcileIntervalMinutes() + ", disabled=" + this.isDisabled() + ", startedTimeoutMilliseconds=" + this.getStartedTimeoutMilliseconds() + ", test=" + this.isTest() + ", completedTimeoutMilliseconds=" + this.getCompletedTimeoutMilliseconds() + ", callType=" + this.getCallType() + ", idempotent=" + this.getIdempotent() + ", shardingStrategy=" + this.getShardingStrategy() + ")";
    }
}
